home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group01b.txt / 000067_icon-group-sender_Fri May 18 16:28:41 2001.msg < prev    next >
Internet Message Format  |  2002-01-03  |  3KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f4INRMg16724
  4.     for icon-group-addresses; Fri, 18 May 2001 16:27:22 -0700 (MST)
  5. Message-Id: <200105182327.f4INRMg16724@baskerville.CS.Arizona.EDU>
  6. From: Chris.D.Tenaglia@jci.com
  7. Subject: Re: Question about entering text/password
  8. To: acarr@email.arizona.edu
  9. Cc: icon-group@cs.arizona.edu
  10. Date: Fri, 18 May 2001 15:11:41 -0500
  11. X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.0.6a
  12.  |January 17, 2001) at 05/18/2001 03:27:36 PM
  13. Errors-To: icon-group-errors@cs.arizona.edu
  14. Status: RO
  15. Content-Length: 2137
  16.  
  17.  
  18. Here's a code snipit I did on DOS Icon.
  19. kbhit and getch do not behave the same
  20. on all platforms. They work good on
  21. solaris and tru-64, but not on hp-ux.
  22. ------------------------------------------------------------------------------
  23. Chris Tenaglia, technical analyst, Johnson Controls
  24. ____________________________________________
  25. procedure main()
  26.  
  27.   username := input("Username:")
  28.   password := ""
  29.   writes("Password:")
  30.   until kbhit() do
  31.     {
  32.     press := getch()
  33.     if press == "\r" then break
  34.     writes("*")
  35.     password ||:= press
  36.     }
  37.   write("\n\nThe password was ",image(password))
  38.   end
  39.  
  40. procedure input(prompt)
  41.   writes(prompt)
  42.   return read()
  43.   end
  44.  
  45.  
  46.  
  47.                                                                                                                
  48.                     acarr@email.a                                                                              
  49.                     rizona.edu           To:     icon-group@CS.Arizona.EDU                                     
  50.                                          cc:                                                                   
  51.                     05/15/01             Subject:     Question about entering text/password                    
  52.                     11:35 PM                                                                                   
  53.                                                                                                                
  54.                                                                                                                
  55.  
  56.  
  57.  
  58.  
  59. Good Morning,
  60.  
  61. I am trying to write a program that requires a password, now I have been
  62. able to read the password from input but it echoes to the screen as plain
  63. text.
  64.  
  65. For example:
  66. username: Foo
  67. password: Bar
  68.  
  69. What I want to do is either:
  70. password: ***
  71. -or-
  72. password:
  73.  
  74. Much like Unix in the last case.
  75.  
  76. Right now I'm just reading the field with a password := read() command,
  77. I'm pretty sure that someone would know how to do it.
  78.  
  79. Thank you --
  80.  
  81. -- Andrew Carr
  82.  
  83.      acarr@email.arizona.edu
  84.  
  85.   *** NEW EMAIL ADDRESS!!!! ***
  86.  
  87. AIM: Andyrew480          ICQ: 3100804
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.